#include <bits/stdc++.h>
using namespace std;
const int M = 1005;
struct people{
    int t, id;
}a[M];
bool cmp(people x, people y){
    if (x.t != y.t)
        return x.t < y.t;
    return x.id < y.id;
}
int main(){
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i].t;
        a[i].id = i;
    }
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++){
        cout << a[i].id << " ";
    }
    cout << endl;
    double ans = 0;
    for (int i = 1; i <= n; i++){
        int x = i;
        while (x--){
            ans += a[x].t;
        }
    }
    ans = ans / n;
    printf("%.2f", ans);
    return 0;
}